package cn.fz.demo06.service;

import cn.fz.demo06.domain.IntentionOutput;
import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

/**
 * 定义ai services，配置相应的使用参数
 * application.yml 配置属性中配置qwen的配置
 */
@AiService(
    wiringMode = AiServiceWiringMode.EXPLICIT,
    chatModel = "customQwenChatModel",
    chatMemory = "chatMemory",
    streamingChatModel = "qwenStreamingChatModel",
    chatMemoryProvider = "chatMemoryProvider",
    tools = "testTools")
public interface AiAssistant {
    String chat(@MemoryId String id,@UserMessage String message);

    Flux<String> chatStream(@MemoryId String id,@UserMessage String message);

    // 增加一个判断用户意图的接口
    @SystemMessage(fromResource = "/message/system/getIntention.txt")
    IntentionOutput getIntention(@MemoryId String id, @UserMessage String message);
}
